<?php

namespace App\Http\Controllers\Api\Dream\Activity;

use App\Api\Helpers\ApiResponse;
use App\Http\Controllers\Controller;
use App\Models\Dream\Activity\Activity;
use Illuminate\Http\Request;

class HomeController extends Controller
{
    use ApiResponse;

    /**
     * 活动页
     */

    //活动首页展示
    public function activityMsg()
    {
      $data_index =  Activity::where('status',1)->orderBy('updated_at','desc')->limit(4)->get();

      return $this->success($data_index);
    }

    //正在进行的活动
    public function nowMsg()
    {
        $data_index =  Activity::where('status',1)->orderBy('updated_at','desc')->get();

        return $this->success($data_index);
    }

    //往期活动
    public function pastMsg()
    {
        $data_index =  Activity::where('status',0)->orderBy('updated_at','desc')->get();

        return $this->success($data_index);
    }




}
